Retrofitting Unit Tests for Parameterized Unit Testing

نویسندگان

  • Suresh Thummalapenta
  • Madhuri R. Marri
  • Tao Xie
  • Nikolai Tillmann
  • Jonathan de Halleux
چکیده

Recent advances in software testing introduced parameterized unit tests (PUT), which accept parameters, unlike conventional unit tests (CUT), which do not accept parameters. PUTs are more beneficial than CUTs with regards to fault-detection capability, since PUTs help describe the behaviors of methods under test for all test arguments. In general, existing applications often include manually written CUTs. With the existence of these CUTs, natural questions that arise are whether these CUTs can be retrofitted as PUTs to leverage the benefits of PUTs, and what are the cost and benefits involved in retrofitting CUTs as PUTs. To address these questions, in this paper, we conduct an empirical study to investigate whether existing CUTs can be retrofitted as PUTs with feasible effort and achieve the benefits of PUTs in terms of additional fault-detection capability and code coverage. We also propose a methodology, called test generalization, that helps in systematically retrofitting existing CUTs as PUTs. Our results on three real-world open-source applications (≈ 4.6 KLOC) show that the retrofitted PUTs detect 19 new defects that are not detected by existing CUTs, and also increase branch coverage by 4% on average (with maximum increase of 52% for one class under test and 10% for one application under analysis) with feasible effort.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Retrofitting unit tests

In this paper we describe techniques that we have found helpful for adding unit tests to existing code that has been written without tests. The paper presents some common coding practices that make unit tests hard to retrofit, and why. For each practice we suggest minimal refactorings to open up the code for testing.

متن کامل

Parameterized GUI Tests

GUI testing is a form of system testing where test cases are based on user interactions. A user interaction may be encoded by a sequence of events (e.g., mouse clicks) together with input data (e.g., string values for text boxes). For selecting event sequences, one can use the black-box approach based on Event Flow Graphs. For selecting input data, one can use the white-box approach based on pa...

متن کامل

A Study of Testing Mean Reversion in the Inflation Rate of Iran’s Provinces: New Evidence Using Quantile Unit Root Test

T his paper is to examine the mean reverting properties of inflation rates for Iran’s 25 provinces over the period from 1990:4 to 2017:7. To the end, we use various conventional univariate linear and non-linear unit root tests, as well as quantile unit root test by Koenker and Xiao (2004). Results of conventional unit root tests indicate that the null hypothesis of the unit root test...

متن کامل

Parameterized Unit Testing in the Open Source Wild

With recent advances in test generation research, powerful test generation tools are now at the fingertips of developers in software industry. For example, Microsoft Research Pex, a state-of-the-art tool based on dynamic symbolic execution, has been shipped as IntelliTest in Visual Studio 2015. For test inputs automatically generated by such tool, to supply test oracles (beyond just uncaught ru...

متن کامل

PeX - Parameterized Unit Tests in Visual Studio

The following seminar paper is dealing with the recently released new test tool PeX by Microsoft Reseach, which stands short for Program Exploration. The main idea behind it is based on Parameterized Unit Tests, a concept trying to get along with some issues evolving from standard unit tests by supporting the developer with the possibility to let PeX automatically explore the possible execution...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2011